package org.bioversityinternational.mgbms.model.domain;

// Generated 28 sept. 2011 15:59:33 by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Contact generated by hbm2java
 */
@Entity
@Table(name = "Contact", schema = "dbo", catalog = "imgbms")
public class Contact implements java.io.Serializable {

	private Integer id;
	private Address address;
	private Country country;
	private String pidCode;
	private String title;
	private String firstName;
	private String lastName;
	private String email;
	private String tel;
	private String fax;
	private Date startDate;
	private Date endDate;
	private Boolean archived;
	private Date lastUpdated;
	private Set<Login> logins = new HashSet<Login>(0);
	private Set<ContactCentre> contactCentres = new HashSet<ContactCentre>(0);
	private Set<AssCentreFunctionContact> assCentreFunctionContacts = new HashSet<AssCentreFunctionContact>(
			0);
	private Set<AssCentreFunctionContact> assCentreFunctionContacts_1 = new HashSet<AssCentreFunctionContact>(
			0);
	private Set<Order> orders = new HashSet<Order>(0);

	public Contact() {
	}

	public Contact(String pidCode) {
		this.pidCode = pidCode;
	}

	public Contact(Address address, Country country, String pidCode,
			String title, String firstName, String lastName, String email,
			String tel, String fax, Date startDate, Date endDate,
			Boolean archived, Date lastUpdated, Set<Login> logins,
			Set<ContactCentre> contactCentres,
			Set<AssCentreFunctionContact> assCentreFunctionContacts,
			Set<AssCentreFunctionContact> assCentreFunctionContacts_1,
			Set<Order> orders) {
		this.address = address;
		this.country = country;
		this.pidCode = pidCode;
		this.title = title;
		this.firstName = firstName;
		this.lastName = lastName;
		this.email = email;
		this.tel = tel;
		this.fax = fax;
		this.startDate = startDate;
		this.endDate = endDate;
		this.archived = archived;
		this.lastUpdated = lastUpdated;
		this.logins = logins;
		this.contactCentres = contactCentres;
		this.assCentreFunctionContacts = assCentreFunctionContacts;
		this.assCentreFunctionContacts_1 = assCentreFunctionContacts_1;
		this.orders = orders;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "addressId")
	public Address getAddress() {
		return this.address;
	}

	public void setAddress(Address address) {
		this.address = address;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "countryId")
	public Country getCountry() {
		return this.country;
	}

	public void setCountry(Country country) {
		this.country = country;
	}

	@Column(name = "pidCode", nullable = false, length = 13)
	public String getPidCode() {
		return this.pidCode;
	}

	public void setPidCode(String pidCode) {
		this.pidCode = pidCode;
	}

	@Column(name = "title", length = 50)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "firstName", length = 50)
	public String getFirstName() {
		return this.firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	@Column(name = "lastName", length = 50)
	public String getLastName() {
		return this.lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	@Column(name = "email", length = 50)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "tel", length = 50)
	public String getTel() {
		return this.tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	@Column(name = "fax", length = 50)
	public String getFax() {
		return this.fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "startDate", length = 23)
	public Date getStartDate() {
		return this.startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "endDate", length = 23)
	public Date getEndDate() {
		return this.endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	@Column(name = "archived")
	public Boolean getArchived() {
		return this.archived;
	}

	public void setArchived(Boolean archived) {
		this.archived = archived;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "lastUpdated", length = 16)
	public Date getLastUpdated() {
		return this.lastUpdated;
	}

	public void setLastUpdated(Date lastUpdated) {
		this.lastUpdated = lastUpdated;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "contact")
	public Set<Login> getLogins() {
		return this.logins;
	}

	public void setLogins(Set<Login> logins) {
		this.logins = logins;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "contact")
	public Set<ContactCentre> getContactCentres() {
		return this.contactCentres;
	}

	public void setContactCentres(Set<ContactCentre> contactCentres) {
		this.contactCentres = contactCentres;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "contact")
	public Set<AssCentreFunctionContact> getAssCentreFunctionContacts() {
		return this.assCentreFunctionContacts;
	}

	public void setAssCentreFunctionContacts(
			Set<AssCentreFunctionContact> assCentreFunctionContacts) {
		this.assCentreFunctionContacts = assCentreFunctionContacts;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "contact")
	public Set<AssCentreFunctionContact> getAssCentreFunctionContacts_1() {
		return this.assCentreFunctionContacts_1;
	}

	public void setAssCentreFunctionContacts_1(
			Set<AssCentreFunctionContact> assCentreFunctionContacts_1) {
		this.assCentreFunctionContacts_1 = assCentreFunctionContacts_1;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "contact")
	@OrderBy("requestdate DESC")
	public Set<Order> getOrders() {
		return this.orders;
	}

	public void setOrders(Set<Order> orders) {
		this.orders = orders;
	}

}
